package csvm_v1.coins;

/**
 * Quarter adalah kelas konkrit turunan dari Coin. Quarter bernilai 25, dengan
 * keterangan dimensi seperti yang tertera pada kelas.
 *
 * @author Muqtafi Akhmad
 */
public class Quarter extends Coin {

    /**
     * ukuran koin Quarter
     */
    private static final float quarterSize = (float) 24.26;
    /**
     * berat koin Quarter
     */
    private static final float quarterWeight = (float) 5.67;
    /**
     * ketebalan koin Quarter
     */
    private static final float quarterThickness = (float) 1.75;
    /**
     * keterangan apakah koin Quarter bergerigi
     */
    private static final boolean quarterIsSerratedEdge = true;
    /**
     * nilai koin Quarter
     */
    private static final int quarterValue = 25;

    /**
     * konstruktor koin Quarter
     */
    public Quarter() {
        super(quarterSize, quarterWeight, quarterThickness, quarterIsSerratedEdge, quarterValue);
    }

    /**
     * mendeteksi apakah objek yang dimasukkan adalah koin Quarter
     *
     * @param size ukuran
     * @param weight berat
     * @param thickness ketebalan
     * @param isSerratedEdge keterangan bergerigi
     * @return apakah Quarter
     */
    public static boolean isQuarter(float size, float weight, float thickness, boolean isSerratedEdge) {
        return (Math.abs(size - quarterSize) < dimensionTolerance * quarterSize) && (Math.abs(weight - quarterWeight) < dimensionTolerance * quarterWeight) && (Math.abs(thickness - quarterThickness) < dimensionTolerance * quarterThickness) && isSerratedEdge == quarterIsSerratedEdge;
    }

    @Override
    public String getCoinName() {
        return "Quarter";
    }
}
